﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GestionAutoEcole.Service.Impl;
using GestionAutoEcole.Service.Factory;
using GestionAutoEcole.DAO.Util;
using GestionAutoEcoleModel;
using System.Data.Objects.DataClasses;
using GestionAutoEcoleCommon.Util;

namespace GestionAutoEcole.Service
{
    class Program
    {
        static void Main(string[] args)
        {
            EleveServiceImpl coursService = ServiceFactoryMaker.getServiceFactory(Constants.factoryPatternMySql).getEleveServiceImpl();
            FonctionServiceImpl fonctionService = ServiceFactoryMaker.getServiceFactory(Constants.factoryPatternMySql).getFonctionServiceImpl();
            EmployeeServiceImpl employeeService = ServiceFactoryMaker.getServiceFactory(Constants.factoryPatternMySql).getEmployeeServiceImpl();
            eleve criteria = new eleve();
            employee emp = new employee();
            fonction fct = fonctionService.FindById(1);
            emp.EMPLOYEE_NOM = "massinissa";
            emp.EMPLOYEE_PRENOM = "massinissa";
            emp.EMPLOYEE_NOM_UTILISATEUR = "massinissa";
            emp.EMPLOYEE_DATE_NAISSANCE = new DateTime(1983, 1, 9);
            emp.fonction = fct;
            employeeService.Create(emp);

            List<eleve> cours = coursService.FindByCriteria(criteria);
            EntityCollection<document> document = cours.ElementAt(0).document;
            document doc = document.ElementAt(0);
            Console.WriteLine("");
        }
    }
}
